//
// metadisassembler_x86.h
//
// Definitions for the MSEC Debugging Extensions Meta-Disassembler for x86 Processors
//
//
// Developed by the Microsoft Security Engineering Center (MSEC)
// Copyright 2008-2013, Microsoft Corporation
//
//	Microsoft Public License (Ms-PL)
//	This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
//
//	Definitions
//		The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. A "contribution" is the original software, or any additions or changes to the software. A "contributor" is any person that distributes its contribution under this license. "Licensed patents" are a contributor's patent claims that read directly on its contribution.
//	Grant of Rights
//		(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
//		(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
//	Conditions and Limitations
//		(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. 
//		(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. 
//		(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. 
//		(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. 
//		(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
//


#pragma once

#include "metadisassembler.h"

#ifdef METADISASSEMBLER_MODULE

///
// Mnemonic Prefixes for multi-word mnemonics
///
PCWSTR X86_MNEMONIC_PREFIXES[] = { L"rep", L"repe", L"repz", L"repne", L"repnz", NULL };

///
// x86 Processor Register Sets
///
PCWSTR X86_REGISTERS[] = {	L"ah", L"al", L"ax", L"eax", 
							L"bh", L"bl", L"bx", L"ebx",
							L"ch", L"cl", L"cx", L"ecx",
							L"dh", L"dl", L"dx", L"edx",
							L"si", L"esi", 
							L"di", L"edi",
							L"sp", L"esp",
							L"bp", L"ebp",
							L"ip", L"eip",
							NULL 
						};


///
// x86 Processor Register Aliases
///
//
// Important note:
//		With x86 registers, we have incomplete aliasing. Because of this, we actually implement two sets of aliases, one for applying
//		taint (which taints all the overlapped registers), and one for clearing taint, which taints only those registers which are completely
//		controlled by the register in question. 
//
// Data Structure:
//
//		The first item in each list is the controlling register, the rest of the list is the cross-mapped registers

OPERAND X86_REGISTER_TAINT_ALIASES[] =  {
											OPERAND_ENTRY(L"al"), OPERAND_ENTRY(L"ax"), OPERAND_ENTRY(L"eax"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"ah"), OPERAND_ENTRY(L"ax"), OPERAND_ENTRY(L"eax"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"ax"), OPERAND_ENTRY(L"ah"), OPERAND_ENTRY(L"al"), OPERAND_ENTRY(L"eax"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"eax"), OPERAND_ENTRY(L"ah"), OPERAND_ENTRY(L"ax"), OPERAND_ENTRY(L"al"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"bl"), OPERAND_ENTRY(L"bx"), OPERAND_ENTRY(L"ebx"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"bh"), OPERAND_ENTRY(L"bx"), OPERAND_ENTRY(L"ebx"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"bx"), OPERAND_ENTRY(L"bh"), OPERAND_ENTRY(L"bl"), OPERAND_ENTRY(L"ebx"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"ebx"), OPERAND_ENTRY(L"bh"), OPERAND_ENTRY(L"bx"), OPERAND_ENTRY(L"bl"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"cl"), OPERAND_ENTRY(L"cx"), OPERAND_ENTRY(L"ecx"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"ch"), OPERAND_ENTRY(L"cx"), OPERAND_ENTRY(L"ecx"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"cx"), OPERAND_ENTRY(L"ch"), OPERAND_ENTRY(L"cl"), OPERAND_ENTRY(L"ecx"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"ecx"), OPERAND_ENTRY(L"ch"), OPERAND_ENTRY(L"cx"), OPERAND_ENTRY(L"cl"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"dl"), OPERAND_ENTRY(L"dx"), OPERAND_ENTRY(L"edx"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"dh"), OPERAND_ENTRY(L"dx"), OPERAND_ENTRY(L"edx"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"dx"), OPERAND_ENTRY(L"dh"), OPERAND_ENTRY(L"dl"), OPERAND_ENTRY(L"edx"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"edx"), OPERAND_ENTRY(L"dh"), OPERAND_ENTRY(L"dx"), OPERAND_ENTRY(L"dl"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"si"), OPERAND_ENTRY(L"esi"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"esi"), OPERAND_ENTRY(L"si"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"di"), OPERAND_ENTRY(L"edi"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"edi"), OPERAND_ENTRY(L"di"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"sp"), OPERAND_ENTRY(L"esp"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"esp"), OPERAND_ENTRY(L"sp"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"bp"), OPERAND_ENTRY(L"ebp"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"ebp"), OPERAND_ENTRY(L"bp"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"ip"), OPERAND_ENTRY(L"ip"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"eip"), OPERAND_ENTRY(L"ip"), END_OPERAND_LIST,
											OPERAND_ENTRY(AUX_FLAG), OPERAND_ENTRY(FLAGS_REGISTER), END_OPERAND_LIST,
											OPERAND_ENTRY(CARRY_FLAG), OPERAND_ENTRY(FLAGS_REGISTER), END_OPERAND_LIST,
											OPERAND_ENTRY(OVERFLOW_FLAG), OPERAND_ENTRY(FLAGS_REGISTER), END_OPERAND_LIST,
											OPERAND_ENTRY(PARITY_FLAG), OPERAND_ENTRY(FLAGS_REGISTER), END_OPERAND_LIST,
											OPERAND_ENTRY(SIGN_FLAG), OPERAND_ENTRY(FLAGS_REGISTER), END_OPERAND_LIST,
											OPERAND_ENTRY(ZERO_FLAG), OPERAND_ENTRY(FLAGS_REGISTER), END_OPERAND_LIST,
											END_OPERAND_LIST 
										};

OPERAND X86_REGISTER_CLEAR_ALIASES[] =  {
											OPERAND_ENTRY(L"ax"), OPERAND_ENTRY(L"al"), OPERAND_ENTRY(L"ah"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"eax"), OPERAND_ENTRY(L"al"), OPERAND_ENTRY(L"ah"), OPERAND_ENTRY(L"ax"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"bx"), OPERAND_ENTRY(L"bl"), OPERAND_ENTRY(L"bh"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"ebx"), OPERAND_ENTRY(L"bl"), OPERAND_ENTRY(L"bh"), OPERAND_ENTRY(L"bx"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"cx"), OPERAND_ENTRY(L"cl"), OPERAND_ENTRY(L"ch"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"ecx"), OPERAND_ENTRY(L"cl"), OPERAND_ENTRY(L"ch"), OPERAND_ENTRY(L"cx"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"dx"), OPERAND_ENTRY(L"dl"), OPERAND_ENTRY(L"dh"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"edx"), OPERAND_ENTRY(L"dl"), OPERAND_ENTRY(L"dh"), OPERAND_ENTRY(L"dx"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"esi"), OPERAND_ENTRY(L"si"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"edi"), OPERAND_ENTRY(L"di"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"esp"), OPERAND_ENTRY(L"sp"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"ebp"), OPERAND_ENTRY(L"bp"), END_OPERAND_LIST,
											OPERAND_ENTRY(L"eip"), OPERAND_ENTRY(L"ip"), END_OPERAND_LIST,
											OPERAND_ENTRY(FLAGS_REGISTER), OPERAND_ENTRY(AUX_FLAG), OPERAND_ENTRY(CARRY_FLAG), OPERAND_ENTRY(OVERFLOW_FLAG), OPERAND_ENTRY(PARITY_FLAG), OPERAND_ENTRY(SIGN_FLAG), OPERAND_ENTRY(ZERO_FLAG), END_OPERAND_LIST,
											END_OPERAND_LIST 
										};

///
// Instruction Analysis Tables
//
// Important Note: These tables use the syntactic sugar definitions that make the code more reasable. These are only
// for readability, the definitions are entirely order dependent
//
// Additional Note: This is known to be an incomplete list of the instruction set
INSTRUCTION_INFO X86_DISASSEMBLY_INFO[] =
{
	// Add with Carry
	BEGIN_FIRST_INSTRUCTION
		EXACT_MNEMONIC( L"adc" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING COMBO_OPERANDS | DEST_OPERAND_IS_IMPLIED_SOURCE
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Add
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"add" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING COMBO_OPERANDS | DEST_OPERAND_IS_IMPLIED_SOURCE
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// And
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"and" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING COMBO_OPERANDS | DEST_OPERAND_IS_IMPLIED_SOURCE
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Bit Scan Forward
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"bsf" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING DEST_REGISTER | SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Bit Scan Reverse
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"bsr" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING DEST_REGISTER | SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Bit Test
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"bt" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING COMBO_OPERANDS | DEST_OPERAND_IS_UNAFFECTED
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Bit Test with Complement
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"btc" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING COMBO_OPERANDS | DEST_OPERAND_IS_UNAFFECTED
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Bit Test with Reset
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"btr" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING COMBO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Bit Test with Set
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"bts" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING COMBO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Call
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"call" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS_ONLY
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		IMPLICIT_PASSED_OR_RETURNED_REGISTERS OPERAND_ENTRY( STACK_CONTENTS ), OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"edx" ), END_OPERAND_LIST
	END_INSTRUCTION

	// Clear Carry Flag
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"clc" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	// Compare
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"cmp" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING COMBO_OPERANDS | DEST_OPERAND_IS_UNAFFECTED | DEST_OPERAND_IS_IMPLIED_SOURCE
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Compare string
	BEGIN_INSTRUCTION
		MNEMONIC( L"cmps" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"esi" ), OPERAND_ENTRY( L"edi" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"rep cmps" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"esi" ), OPERAND_ENTRY( L"edi" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"repe cmps" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"esi" ), OPERAND_ENTRY( L"edi" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"repne cmps" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"esi" ), OPERAND_ENTRY( L"edi" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"repz cmps" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"esi" ), OPERAND_ENTRY( L"edi" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"repnz cmps" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"esi" ), OPERAND_ENTRY( L"edi" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Compare and exchange
	//
	// There is no good way to currently implement this instruction. Either destination goes to EAX, or source
	// goes to destination. However we do this, the taint tracking is going to be off. For the moment, we will overtaint
	// and EAX and destination will both be tainted if either the source or the destination are tainted
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"cmpxchg" )
		INSTRUCTION_CLASSIFICATION DATA_MOVE
		OPERAND_ENCODING DEST_OPERANDS | SOURCE_REGISTER  | DEST_OPERAND_IS_IMPLIED_SOURCE
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"eax" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( L"eax" ), OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Sign extend AX to EAX
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"cwde" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ax" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( L"eax" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Decrement
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"dec" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING DEST_OPERANDS | DEST_OPERAND_IS_IMPLIED_SOURCE
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Divide
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"div" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ax" ), OPERAND_ENTRY( L"dx" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( L"ax" ), OPERAND_ENTRY( L"dx" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Interrupt
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"int" )
		INSTRUCTION_CLASSIFICATION INTERRUPT
		OPERAND_ENCODING NO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Signed division
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"idiv" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ax" ), OPERAND_ENTRY( L"dx" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( L"ax" ), OPERAND_ENTRY( L"dx" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Increment
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"inc" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING DEST_OPERANDS | DEST_OPERAND_IS_IMPLIED_SOURCE
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Interrupt Return
	BEGIN_INSTRUCTION
		MNEMONIC( L"iret" )
		INSTRUCTION_CLASSIFICATION RETURN
		OPERAND_ENCODING NO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( STACK_CONTENTS ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Jump Instructions
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"ja" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jae" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jb" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jbe" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jc" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jcxz" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"cx" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"je" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jecxz" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jg" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jge" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jl" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jle" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jmp" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS 
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jna" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jnae" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jnb" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jnbe" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jnc" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jne" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jng" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jnge" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jnl" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jnle" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jno" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( OVERFLOW_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jnp" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( PARITY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jns" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( SIGN_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"jp" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( PARITY_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"js" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( SIGN_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"jz" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Load accumulator with flags
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"lahf" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( L"ah" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Load effective address
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"lea" )
		INSTRUCTION_CLASSIFICATION DATA_MOVE
		OPERAND_ENCODING COMBO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Load String
	BEGIN_INSTRUCTION
		MNEMONIC( L"lods" )
		INSTRUCTION_CLASSIFICATION DATA_MOVE
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( L"eax" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Loop
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"loop" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING NO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"loop" )
		INSTRUCTION_CLASSIFICATION BRANCH
		OPERAND_ENCODING NO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Move
	BEGIN_INSTRUCTION
		MNEMONIC( L"mov" )
		INSTRUCTION_CLASSIFICATION DATA_MOVE
		OPERAND_ENCODING COMBO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Block Move
	//
	// Taint information for EDI, ESI, and ECX can be wrong after a block move.
	//
	// ECX is actually cleared of taint at the end, but ESI and EDI should be tainted if and only if ECX is tainted, and
	// not if the actual source buffer is tainted. The fact that we can't handle this case is a limitation of the current
	// taint tracking system that doesn't differentiate between taint sources.
	BEGIN_INSTRUCTION
		MNEMONIC( L"rep mov" )
		INSTRUCTION_CLASSIFICATION BLOCK_DATA_MOVE
		OPERAND_ENCODING COMBO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"esi" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		IMPLICIT_DESTINATION_POINTER_REGISTERS OPERAND_ENTRY( L"edi" ), END_OPERAND_LIST
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"repe mov" )
		INSTRUCTION_CLASSIFICATION BLOCK_DATA_MOVE
		OPERAND_ENCODING COMBO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"esi" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( L"ecx" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_POINTER_REGISTERS OPERAND_ENTRY( L"edi" ), END_OPERAND_LIST
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"repne mov" )
		INSTRUCTION_CLASSIFICATION BLOCK_DATA_MOVE
		OPERAND_ENCODING COMBO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"esi" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( L"ecx" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_POINTER_REGISTERS OPERAND_ENTRY( L"edi" ), END_OPERAND_LIST
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"repz mov" )
		INSTRUCTION_CLASSIFICATION BLOCK_DATA_MOVE
		OPERAND_ENCODING COMBO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"esi" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( L"ecx" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_POINTER_REGISTERS OPERAND_ENTRY( L"edi" ), END_OPERAND_LIST
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"repnz mov" )
		INSTRUCTION_CLASSIFICATION BLOCK_DATA_MOVE
		OPERAND_ENCODING COMBO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"esi" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( L"ecx" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_POINTER_REGISTERS OPERAND_ENTRY( L"edi" ), END_OPERAND_LIST
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Unsigned Multiply
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"mul" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING SOURCE_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"eax" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( L"eax" ), OPERAND_ENTRY( L"edx" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Negate
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"neg" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING DEST_OPERANDS | DEST_OPERAND_IS_IMPLIED_SOURCE
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Or
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"or" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING COMBO_OPERANDS | DEST_OPERAND_IS_IMPLIED_SOURCE
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Pop
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"pop" )
		INSTRUCTION_CLASSIFICATION STACK_POP
		OPERAND_ENCODING DEST_REGISTER 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"esp" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"popa" )
		INSTRUCTION_CLASSIFICATION STACK_POP
		OPERAND_ENCODING DEST_REGISTER 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"esp" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( L"edi" ), OPERAND_ENTRY( L"esi" ), OPERAND_ENTRY( L"ebp" ), OPERAND_ENTRY( L"esp" ), OPERAND_ENTRY( L"ebx" ), OPERAND_ENTRY( L"edx" ), OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"eax" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"popf" )
		INSTRUCTION_CLASSIFICATION STACK_POP
		OPERAND_ENCODING DEST_REGISTER
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"esp" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( FLAGS_REGISTER ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
		
	// Push
	//
	// We don't include the StackContents as a specific taint (in fact, this is forbidden), instead, we allow the lightweight 
	// stack model in the taint tracking to manage it for us
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"push" )
		INSTRUCTION_CLASSIFICATION STACK_PUSH
		OPERAND_ENCODING SOURCE_REGISTER 
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		NO_IMPLICIT_DESTINATION_REGISTERS
		IMPLICIT_DESTINATION_POINTER_REGISTERS OPERAND_ENTRY( L"esp" ), END_OPERAND_LIST
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"pusha" )
		INSTRUCTION_CLASSIFICATION STACK_PUSH
		OPERAND_ENCODING SOURCE_REGISTER 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"eax" ), OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"edx" ), OPERAND_ENTRY( L"ebx" ), OPERAND_ENTRY( L"esp" ), OPERAND_ENTRY( L"ebp" ), OPERAND_ENTRY( L"esi" ), OPERAND_ENTRY( L"edi" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		IMPLICIT_DESTINATION_POINTER_REGISTERS OPERAND_ENTRY( L"esp" ), END_OPERAND_LIST
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"pushf" )
		INSTRUCTION_CLASSIFICATION STACK_PUSH
		OPERAND_ENCODING SOURCE_REGISTER
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( FLAGS_REGISTER ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		IMPLICIT_DESTINATION_POINTER_REGISTERS OPERAND_ENTRY( L"esp" ), END_OPERAND_LIST
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Return
	BEGIN_INSTRUCTION
		MNEMONIC( L"ret" )
		INSTRUCTION_CLASSIFICATION RETURN
		OPERAND_ENCODING NO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( STACK_CONTENTS ), OPERAND_ENTRY( L"esp" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		IMPLICIT_PASSED_OR_RETURNED_REGISTERS OPERAND_ENTRY( L"eax" ), OPERAND_ENTRY( L"edx" ), END_OPERAND_LIST
	END_INSTRUCTION

	// Scan String
	//
	// Note that the SCAS instruction will treat all of EAX as a source, even though which part of EAX
	// is used depends on whether we are in byte, word, or doubleword mode. However, the meta-disassembler removes
	// that information from the source, so we have to assume EAX
	BEGIN_INSTRUCTION
		MNEMONIC( L"scas" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"eax" ), OPERAND_ENTRY( L"edi" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"rep scas" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"eax" ), OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"edi" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"repe scas" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"eax" ), OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"edi" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"repne scas" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"eax" ), OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"edi" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"repz scas" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"eax" ), OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"edi" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	BEGIN_INSTRUCTION
		MNEMONIC( L"repnz scas" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING NO_OPERANDS 
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"eax" ), OPERAND_ENTRY( L"ecx" ), OPERAND_ENTRY( L"edi" ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Subtract
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"sub" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING COMBO_OPERANDS | DEST_OPERAND_IS_IMPLIED_SOURCE
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( AUX_FLAG ), OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Test
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"test" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING COMBO_OPERANDS | DEST_OPERAND_IS_IMPLIED_SOURCE | DEST_OPERAND_IS_UNAFFECTED
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Exchange
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"xchg" )
		INSTRUCTION_CLASSIFICATION DATA_EXCHANGE
		OPERAND_ENCODING COMBO_OPERANDS
		NO_ANALYSIS_FUNCTIONS
		NO_IMPLICIT_SOURCE_REGISTERS
		NO_IMPLICIT_DESTINATION_REGISTERS
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

    // XLAT
    BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"xlat" )
		INSTRUCTION_CLASSIFICATION DATA_MOVE
		OPERAND_ENCODING SOURCE_POINTER | DEST_REGISTER
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"al" ), OPERAND_ENTRY( L"ebx" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY(L"al" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
	


    // XLATB
    BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"xlatb" )
		INSTRUCTION_CLASSIFICATION DATA_MOVE
		OPERAND_ENCODING SOURCE_POINTER | DEST_REGISTER
		NO_ANALYSIS_FUNCTIONS
		IMPLICIT_SOURCE_REGISTERS OPERAND_ENTRY( L"al" ), OPERAND_ENTRY( L"ebx" ), END_OPERAND_LIST
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY(L"al" ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION

	// Exclusive Or
	BEGIN_INSTRUCTION
		EXACT_MNEMONIC( L"xor" )
		INSTRUCTION_CLASSIFICATION CALCULATION
		OPERAND_ENCODING COMBO_OPERANDS | DEST_OPERAND_IS_IMPLIED_SOURCE
		ANALYSIS_FUNCTIONS  ReflexiveCancellationAnalysisOverride, END_FUNCTION_LIST
		NO_IMPLICIT_SOURCE_REGISTERS
		IMPLICIT_DESTINATION_REGISTERS OPERAND_ENTRY( CARRY_FLAG ), OPERAND_ENTRY( OVERFLOW_FLAG ), OPERAND_ENTRY( SIGN_FLAG ), OPERAND_ENTRY( PARITY_FLAG ), OPERAND_ENTRY( ZERO_FLAG ), END_OPERAND_LIST
		NO_IMPLICIT_DESTINATION_POINTER_REGISTERS
		NO_IMPLICIT_PASSED_OR_RETURNED_REGISTERS
	END_INSTRUCTION
};

#endif
